home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville, MI
- Date: 04-25-93 (18:43) Number: 145
- From: DOUG RICKARD Refer#: 20
- To: PATRICK FOX Recvd: NO
- Subj: dac output Conf: (36) C Language
- ---------------------------------------------------------------------------
- /* DAC2.C */
- /* Create saw tooth waveform */
-
- #include <conio.h>
-
- int main(void)
- {
- char i;
- unsigned int porta = 0x378;
- unsigned int portc = 0x37A;
- unsigned int clock = 0x021;
-
- outp(clock,(inp(clock) | 1)); /* Disable clock interrupts */
-
- for (;;)
- {
- for (i=0;i<128;i++)
- {
- outp(portc,255); /* Generate a synch pulse */
- outp(portc,0); /* for an oscilloscope */
- }
-
- for (i=0;i<256;i++) /* Cycle through 256 steps */
- {
- outp(porta,i); /* Send output to DAC */
- }
- }
-
- outp(clock,(inp(clock) & 0xFE)); /* Re-enable clock interrupts */
-
- return 1;
- }
-
-
- --- Maximus/2 2.01wb
- * Origin: Brisbug PC User Group BBS (3:640/821)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 280/1
- SEEN-BY: 390/1 396/1 5 15 2270/1 2440/5 3603/20
-